home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / wildcat / qwkhold1.zip / LOGON2.WCC < prev    next >
Text File  |  1996-05-17  |  25KB  |  566 lines

  1. 'LOGON2.WCC by James Mardis  (FidoNet 1:322/746)  5/7/96
  2. '
  3. 'This program notifies callers that they have PreScanned QWK mail waiting
  4. 'for pickup when the call in and allows them to download it.  The compiled
  5. 'version can be named either LOGON1.WCX or LOGON2.WCX but LOGON2.WCX is the
  6. 'preferred title as it will allow users the oprion of reading messages that
  7. 'may have come in after the QWK bundle was made, if they so choose.
  8. 'It is used with it's companion programs QWK2MAKE.WCC and QWK2HOLD.WCC.
  9. '
  10. 'You may Freely modify this program as long as you do NOT charge for
  11. 'it's use in this form or the modified form.  This program is in the
  12. 'public domain.  This program carries no Warranty, Guarantee whatsover.
  13. 'You use this program at your own risk.  The original Author shall NOT
  14. 'be held responsible for any damages whatsoever as to the result or use
  15. 'of this program.   After all, It is in the public Domain and is subject
  16. 'to change without the knowledge of the Author (James Mardis).
  17. '
  18. '
  19. 'The configuration file, QWK2HOLD.CFG breaks down as follows:
  20. 'Line #1, Complete PathName where WCMAIL QWK stores mail packets,
  21. '         such as C:\WILDCAT\MAIL\QWK\
  22. '
  23. 'Line #2, File area number for QWK Mail that was choosen in the Makewild
  24. '         QWK Mail area.
  25. '
  26. 'Line #3, Complete PathName where QWK2 can store all user mail packets.
  27. '
  28. 'Line #4, Valid values are COMMENT(1) thru COMMENT(5) exactly as shown.
  29. '         The right and left parentheses around the number are
  30. '         manditory.
  31. '
  32. '         The actual value found in the user's COMMENT(?) field will
  33. '         contain either QWK2 ON  XX or QWK2 OFF XX where XX equals
  34. '         the number of mail packets that are currently in storage.
  35. '         The XX field must begin at character 10 in the comment field.
  36. '
  37. 'Line #5, Security Profile #1 to exclude from operating this program.
  38. '         I use this to bar NEWUSER from this program
  39. '         while allowing them access to other WCX programs.
  40. '         If not used set it to NO SEC1.
  41. '
  42. 'Line #6, Security Profile #2 to exclude from operating this program.
  43. '         If not used set it at NO SEC2.
  44. '
  45. 'Line #7  Maximum number of QWK packets a caller can have waiting for pickup.
  46. '         Valid values are 1 to 26.
  47. '
  48. 'Line #8  Maximum number of days to keep stored QWK packets.
  49. '         Valid values are 1 to 365.
  50. '
  51. 'Line #9  Maximum allowed storage space for user packets in bytes, but
  52. '         a minimum of 1 packet is allowed regardless of this value.
  53. '         Valid values are 1 to 2147483647, this is in bytes like
  54. '         what you see when listing a DOS directory from DOS.
  55. '
  56. 'Line #10 Conference number where user messages are to be sent.
  57. '         Messages will be sent with the Private flag turned on.
  58. '
  59. 'Line #11 Prompt colors normal for Text and Background, leave off @ symbols.
  60. '         Default two character code is 0E.
  61. '
  62. 'Line #12 Prompt colors normal for Highlighted Text.
  63. '         Default two character code is 0B.
  64. '
  65. 'Line #13 Prompt colors normal for Packet size and elsewhere.
  66. '         Default two character code is 0C.
  67. '
  68. 'Line #14 Prompt colors normal for warning messages.
  69. '         Default two character code is 0E.
  70. '
  71. 'Line #15 Path to inbound mail flag,  Where to find QWK2MA?.FLG.
  72. '
  73. 'Line #16 Text to display when Mail Flag #1 is found.
  74. '
  75. 'Line #17 Text to display when Mail Flag #2 is found.
  76. '
  77. 'Line #18 Text to display when Mail Flag #3 is found.
  78. '
  79. 'Line #19 Text to display when Mail Flag #4 is found.
  80. '
  81. 'Line #20 Text to display when Mail Flag #5 is found.
  82. '
  83. dim BadEnd as Integer        'Value to trigger program failure message.
  84. dim ChaStr1 as String        'Junk String Variable, re-used at will.
  85. dim ChaStr2 as String        'Junk String Variable, re-used at will.
  86. dim CurCode as Date          'Current Date while in ddmmyyyy format.
  87. dim CurDate as Integer       'Current date coded in DOS format.
  88. dim CurDay as String         'Current Day while code is run.
  89. dim CurMonth as String       'Current Month while code is run.
  90. dim CurYear as String        'Current Year while code is run.
  91. dim FileDos as Word          'File date in DOS code format.
  92. dim FileNm2 as String        'Used to Open assorted files.
  93. dim FileSearch as SearchRec  'Search record array for file info.
  94. dim FileSize as Long         'Current file size.
  95. dim FindQWK as Integer       '"For" loop counter vailable.
  96. dim FindUser as Integer      '"For" loop counter variable.
  97. dim MaxAge as Integer        'QWK2HOLD.CFG #8, Maximum # of days packets kept.
  98. dim MaxPacket as Integer     'QWK2HOLD.CFG #7, Maximum allowed QWK packets.
  99. dim MaxSize as Long          'QWK2HOLD.CFG #9, Maximum size of all packets.
  100. dim MaxUser as Integer       'Total number of users in userlist.
  101. dim MsgHd as MessageHeader   'Used to send messages.
  102. dim MsgPlace as Integer      'QWK2HOLD.CFG #10, Conference where messages go.
  103. dim NewFile as String        'New QWK file name.
  104. dim NumInt1 as Integer       'Junk Integer Variable, re-used at will.
  105. dim NumInt2 as Integer       'Junk Integer Variable, re-used at will.
  106. dim OldAge as Integer        'Oldest number of packet days in existance.
  107. dim OldFile as String        'Old QWK file name.
  108. dim P1 as String             'QWK.CFG #11, Prompt #1 Color.
  109. dim P2 as String             'QWK.CFG #12, Prompt #2 Color.
  110. dim P3 as String             'QWK.CFG #13, Prompt #3 Color.
  111. dim P4 as String             'QWK.CFG #14, Prompt #4 Color.
  112. dim MailProc1 as String      'QWK.CFG #16, Prompt for mail flag #1
  113. dim MailProc2 as String      'QWK.CFG #17, Prompt for mail flag #2
  114. dim MailProc3 as String      'QWK.CFG #18, Prompt for mail flag #3
  115. dim MailProc4 as String      'QWK.CFG #19, Prompt for mail flag #4
  116. dim MailProc5 as String      'QWK.CFG #20, Prompt for mail flag #5
  117. dim QWKAge as Integer        'Current age of the packet in days.
  118. dim QWKFlag as String        'QWK2HOLD.CFG #4, QWK search variable.
  119. dim QWKInbound as String     'QWK2HOLD.CFG #15, Path to mail flag.
  120. dim QWKLocal as String       'Path where Sysop's local QWK packets wind up.
  121. dim QWKRoute as String       'QWK2HOLD.CFG #3, Path to QWK2 mail packets.
  122. dim QWKTotal as Integer      'Total number of QWK packets for user.
  123. dim QWKLeft as Integer       'Total number of QWK packets a user has left.
  124. dim QWKSysop as String       'Path choosen by Sysop for local transfer.
  125. dim SecPro1 as String        'QWK2HOLD.CFG #5, Security Profile #1 restriction.
  126. dim SecPro2 as String        'QWK2HOLD.CFG #6, Security Profile #2 restriction.
  127. dim Size as Long             'Place to store total size of stored packets.
  128. dim UKey as String           'Used to determine user's choice.
  129. dim WCMailRoute as String    'QWK2HOLD.CFG #1, Path where WCMAIL stores packets.
  130. dim WCMailZip as Integer     'QWK2HOLD.CFG #2, File area number used in WCMAIL.
  131. dim QWKDown as String        'Used to determine if user wants to download QWK.
  132. '
  133. ChaStr2 = "QWK2: Logon program was started."
  134. ActivityLog ChaStr2
  135. 'Start main program here, after the variables
  136. EnablePages Off ' Disable inbound page till program ends, resets at end.
  137. FileNm2 = ProgPath + "QWK2HOLD.CFG" 'QWK2HOLD.CFG is the configuration file.
  138. If Exists (FileNm2) then              'If QWK2HOLD.CFG exists, get data.
  139.   OPEN FileNm2 for Input as #1        'Open CFG file for reading.
  140.   If Not(local) Then CarrierCheck Off 'Ignore modem till entire file read.
  141.   LockFile (1,0,1)                    'Temporary file lock for multinode use.
  142.   Input #1, WCMailRoute  '#1,  Path where WCMAIL stores packets.
  143.   Input #1, WCMailZip    '#2,  File directory # from MAKEWILD(WCMAIL).
  144.   Input #1, QWKRoute     '#3,  Path to QWK Mail Packets.
  145.   Input #1, QWKFlag      '#4,  User QWK Comment(?) action.
  146.   Input #1, SecPro1      '#5,  Security Exclusion Value #1.
  147.   Input #1, SecPro2      '#6,  Security Exclusion Value #2.
  148.   Input #1, MaxPacket    '#7,  Maximum number of user QWK Packets.
  149.   Input #1, MaxAge       '#8,  Maximum # of days to keep stored packets.
  150.   Input #1, MaxSize      '#9,  Maximum size of storage for user packets.
  151.   Input #1, MsgPlace     '#10, Conference number where messages are to go.
  152.   Input #1, P1           '#11, Prompt color for normal text.
  153.   Input #1, P2           '#12, Prompt color for highlighted text.
  154.   Input #1, P3           '#13, Prompt color for Packet size.
  155.   Input #1, P4           '#14, Prompt color for Alert Messages.
  156.   Input #1, QWKInbound   '#15, Path to inbound mail flag, if mail processing.
  157.   Input #1, MailProc1    '#16, Mail Processing message #1.
  158.   Input #1, MailProc2    '#17, Mail Processing message #2.
  159.   Input #1, MailProc3    '#18, Mail Processing message #3.
  160.   Input #1, MailProc4    '#19, Mail Processing message #4.
  161.   Input #1, MailProc5    '#20, Mail Processing message #5.
  162.   UnlockFile (1,0,1)                  'Remove temporary file lock.
  163.   Close #1                            'Close the CFG file.
  164.   If Not(Local) Then CarrierCheck On  'File read, exit if carrier dropped.
  165. Else 'Go here if no CFG file is found.
  166.   BadEnd = 0 'Set up error message.
  167.   Goto Problem 'No CFG file was found, abort the program.
  168. End If 'End of LOGIN2.CFG input.
  169. If (User.SecLevel = SecPro1) or (User.SecLevel = SecPro2) Then
  170.   BadEnd = 23: Goto Problem
  171. End If
  172. 'Validate read QWK2HOLD.CFG file data.
  173. If WCMailRoute = "" Then
  174.   BadEnd = 1: Goto Problem 'WCMail Path missing, QWK2HOLD.CFG LINE #1.
  175.   Else 'WCMailroute actually contains something.
  176.     WCMailRoute = Trim(UCase(WCMailRoute)) 'Make it Uppercase & Trim spaces.
  177.     If Mid(WCMailRoute,2,2) <> ":\" Then BadEnd = 1: Goto Problem
  178.     If Right(WCMailRoute,1) <> "\" Then 'Verify path ends in a backslash.
  179.        WCMailRoute = WCMailRoute + "\" 'Slash was added.
  180.     End If 'End of WCMailRoute slash check.
  181. End If 'End of WCMailRoute check.
  182. If QWKRoute = "" Then
  183.   BadEnd = 2: Goto Problem 'QWKRoute missing, QWK2HOLD.CFG LINE #2.
  184. Else 'QWKRoute actually contains something.
  185.   QWKRoute = Trim(UCase(QWKRoute)) 'Make it Uppercase & Trim spaces.
  186.   IF Mid(QWKRoute,2,2) <> ":\" Then BadEnd = 2: Goto Problem
  187.   IF Right(QWKRoute,1) <> "\" Then 'Verify path ends in backslash.
  188.      QWKRoute = QWKRoute + "\" 'Slash was added.
  189.   End If 'End of QWKRoute slash check.
  190. End If 'End of QWKRoute check.
  191. If QWKFlag = "" Then 'Does QWKFlag value exist in  the CFG file.
  192.   BadEnd = 3: Goto Problem 'QWKFlag missing, QWK2HOLD.CFG Line #3.
  193. Else 'QWKFlag actually contains something.
  194.   QWKFlag = UCase(QWKFlag) 'Make it Uppercase.
  195. End If' End of If QWKFlag.
  196. If SecPro1 = "" Then
  197.   SecPro1 = "NO SEC1" 'If no QWK2HOLD.CFG Line #5, set value.
  198. Else 'SecPro1 actually contains something.
  199.   SecPro1 = Trim(UCase(SecPro1)) 'Make it Uppercase & Trim spaces.
  200. End If
  201. If SecPro2 = "" Then
  202.   SecPro2 = "NO SEC2" 'If no QWK2HOLD.CFG Line #6, set value.
  203. Else 'SecPro2 actually contains something.
  204.   SecPro2 = Trim(UCase(SecPro2)) 'Make it Uppercase & Trim spaces.
  205. End If
  206. If QWKInbound = "" Then
  207.   BadEnd = 15: Goto Problem 'QWKInbound missing, QWK2HOLD.CFG LINE #15.
  208. Else 'QWKInbound actually contains something.
  209.   QWKInbound = Trim(UCase(QWKInbound)) 'Make it Uppercase & Trim spaces.
  210.   IF Mid(QWKInbound,2,2) <> ":\" Then BadEnd = 15: Goto Problem
  211.   IF Right(QWKInbound,1) <> "\" Then 'Verify path ends in backslash.
  212.     QWKInbound = QWKInbound + "\" 'Slash was added.
  213.   End If 'End of QWKInbound slash check.
  214. End If
  215. If MaxPacket <= 0 Then MaxPacket = 1 'Minimum value is 1.
  216. If MaxPacket >= 26 Then MaxPacket = 26 'Had to set a limit somewhere.
  217. If MaxAge <= 0 Then MaxAge = 0 'Keep the old packets forever.
  218. If MaxAge >= 365 Then MaxAge = 365 'Maximum life of packets is 1 year.
  219. If MaxSize <= 0 Then MaxSize = 2147483647 'If zero, set limit at highest.
  220. If MaxSize >= 2147483647 Then MaxSize = 2147483647 'Set maximum size limit.
  221. If P1 = "" or Len(P1) <> 2 Then 'Check prompt P1, normal text.
  222.   P1 = "@0E@" 'Set default prompt.
  223. Else P1 = "@" + UCase(P1) + "@"
  224. End If
  225. If P2 = "" or Len(P2) <> 2 Then 'Check prompt P2, highlighted text.
  226.   P2 = "@0F@" 'Set default prompt.
  227. Else P2 = "@" + UCase(P2) + "@"
  228. End If
  229. If P3 = "" or Len(P3) <> 2 Then 'Check prompt P3, Packet sizes.
  230.   P3 = "@0B@" 'Set default prompt.
  231. Else P3 = "@" + UCase(P3) + "@"
  232. End If
  233. If P4 = "" or Len(P4) <> 2 Then 'Check prompt P4, alert text.
  234.   P4 = "@0C@" 'Set default prompt.
  235. Else P4 = "@" + UCase(P4) + "@"
  236. End If
  237. CurrentDate(CurCode) 'Put date into CurDate.
  238. ChaStr1 = FormatDate(CurCode,"ddmmyyyy") 'Convert data into usable String.
  239. CurDay = Left(ChaStr1,2) 'Current Day established, used for CurDate.
  240. CurMonth = Mid(ChaStr1,3,2) 'Current Month established, used for CurDate.
  241. CurYear = Mid(ChaStr1,5,4) 'Current Year established, used for CurDate.
  242. 'Following line codes Wildcat! date to DOS style date for comparisons.
  243. CurDate = ((Val(CurYear)-1980)*512) + (Val(CurMonth)*32)+Val(CurDay)
  244. If WCMailRoute = QWKRoute Then
  245.   ChaStr2 = "QWK2: Line #1 and Line #3 of QWK2HOLD.CFG MUST NOT be the same."
  246.   ActivityLog ChaStr2
  247.   Goto Finished
  248. End If
  249. '>>>----> End of Configuration file and variable setup.
  250.  
  251. 'Clean up loop, in case caller lost carrier during downloading.
  252. NumInt1 = 0
  253. FindQWK = 0
  254. Do While FindQWK < MaxPacket
  255.   NewFile = QWKRoute + Str(User.UserID) + ".QW" + Chr(NumInt1 + 65)
  256.   OldFile = QWKRoute + Str(User.UserID) + ".QW" + Chr(FindQWK + 65)
  257.   If Exists(OldFile) Then 'OldFile already exists so go add one and go on.
  258.     FindQWK = FindQWK + 1
  259.     NumInt1 = NumInt1 + 1
  260.     If OldFile <> NewFile Then 'OldFile exists but does it match Newfile
  261.       Name OldFile as NewFile' Nope, rename Oldfile to fill gap.
  262.     End If 'End of If Oldfile <> Newfile
  263.   ELSE 'Oldfile was not found, increment and go thru loop again.
  264.     FindQWK = FindQWK + 1
  265.   End If 'End of If Exists(Oldfile)
  266. Loop
  267. 'End of Clean up loop
  268.  
  269. QWKTotal = NumInt1
  270. NumInt1 = 0 'Will turn into non-zero if flag is raised.
  271. NewFile = QWKRoute + Str(User.UserID) + ".QWA"
  272. OldFile = WCMailRoute + Str(User.UserID) + ".QWK"
  273. If Exists(QWKInbound + "QWK2MA1.FLG") Then
  274.   NumInt1 = 1
  275.   If MailProc1 <> "" Then
  276.     Print P4;MailProc1
  277.   Else
  278.     Print P4;"Mail Flag #1 is currently flying high."
  279.   End If 'End of message1.
  280. End If 'End of flag1.
  281.  
  282. If Exists(QWKInbound + "QWK2MA2.FLG") Then
  283.   NumInt1 = 1
  284.   If MailProc2 <> "" Then
  285.     Print P4;MailProc2
  286.   Else
  287.     Print P4;"Mail Flag #2 is currently flying high."
  288.   End If 'End of message2.
  289. End If 'End of flag2.
  290.  
  291. If Exists(QWKInbound + "QWK2MA3.FLG") Then
  292.   NumInt1 = 1
  293.   If MailProc3 <> "" Then
  294.     Print P4;MailProc3
  295.   Else
  296.     Print P4;"Mail Flag #3 is currently flying high."
  297.   End If 'End of message3.
  298. End If 'End of flag3.
  299.  
  300. If Exists(QWKInbound + "QWK2MA4.FLG") Then
  301.   NumInt1 = 1
  302.   If MailProc4 <> "" Then
  303.     Print P4;MailProc4
  304.   Else
  305.     Print P4;"Mail Flag #4 is currently flying high."
  306.   End If 'End of message4.
  307. End If 'End of flag4.
  308.  
  309. If Exists(QWKInbound + "QWK2MA5.FLG") Then
  310.   NumInt1 = 1
  311.   If MailProc5 <> "" Then
  312.     Print P4;MailProc5
  313.   Else
  314.     Print P4;"Mail Flag #5 is currently flying high."
  315.   End If 'End of message5.
  316. End If 'End of flag5.
  317. Print
  318. If Trim(Left(User.Comment(Val(Mid(QWKFlag,9,1))),8)) = "QWK2 ON" Then
  319.   If NumInt1 = 1 Then
  320.     Print P3;"If you are still ""Online"" when your QWK Packet(s) are due to be made"
  321.     Print P3;"then yours will be skipped till the next time mail is processed."
  322.     Print
  323.     Delay 3
  324.   End If
  325.   ELSE
  326.     If NumInt1 = 1 Then
  327.       Delay 3
  328.     End If
  329. End If
  330.  
  331. If Exists(NewFile) or Exists(OldFile) Then
  332.   FindQWK = 0
  333.   Print P1;"At least one QWK mail packet is on hold, looking for others."
  334.   Print
  335.   Print P1;"  FileName    Size in Kbytes    Age";P2
  336.   NewFile = QWKRoute + Str(User.UserID) + ".QW" + Chr(FindQWK + 65)
  337.   OldFile = QWKRoute + Str(User.UserID) + ".QW" + Chr(NumInt1 + 65)
  338.   FindQWK = 0
  339.   Do While FindQWK < MaxPacket
  340.     Newfile = QWKRoute + Str(User.UserID) + ".QW" + Chr(FindQWK + 65)
  341.     If Exists(NewFile) Then 'Checking for existing stored packet.
  342.       FindFirst(NewFile,0,FileSearch)
  343.       FileSize=FileSearch.Size
  344.       FileDos=FileSearch.DosDate
  345.       Size = Size + FileSearch.Size
  346.       Print P2;LeftPad(UCase(Trim(MakeWild.PacketID)) + ".QW" + Chr(FindQWK + 65),8);
  347.       Print P3;LeftPad(Str(Int(FileSearch.Size/100)),11);
  348.       Print P2;LeftPad(Str(CurDate - FileDos),10);
  349.       If CurDate - FileDos = 1 Then
  350.         Print P1;" Day"
  351.       Else
  352.         If CurDate - FileDos = 0 Then
  353.           Print P1;" Today"
  354.         Else
  355.           Print P1;" Days"
  356.         End If 'End If age = 0
  357.       End If 'End of If age = 1
  358.     Else 'Ran out of files to check in QWK2.
  359.       Exit Do 'Early escape out of the Do While loop.
  360.     End If 'Done checking for existing packet.
  361.     FindQWK = FindQWK + 1
  362.   Loop' Run thru the Do While loop again.
  363.   'Look for orphaned QWK packets the user may have made with WCMAIL.
  364.   ChaStr1 = QWKRoute + Str(User.UserID)'Partial Newfile.
  365.   If QWKTotal >= 26 then 'If number of packets already at limit.
  366.     NumInt1 = 48' Make packet end in zero.
  367.   Else 'Go look for more packets.
  368.     NumInt1 = QWKTotal + 1'Otherwise make it next letter in alphabet.
  369.   End If 'Done determining new packets for NewFile construction.
  370.   NewFile = ChaStr1 + ".QW" + Chr(NumInt1) 'Newfile variable.
  371.   OldFile = WCMailRoute + Str(User.UserID) + ".QWK" 'OldFile Variable.
  372.   If Exists(OldFile) Then 'Get ready to relocate WCMAIL QWK Packet.
  373.     CopyFile(OldFile,NewFile) 'Copy WCMAIL QWK packet to storage.
  374.     ChaStr1 = Str(User.UserID) + ".QWK"
  375.     DeleteFile(ChaStr1,WCMailZip,1) 'Delete old QWK file from disk & records.
  376.     QWKTotal = QWKTotal + 1'Increment total number of stored packets.
  377.     FindFirst(NewFile,0,FileSearch) 'Establish FileSearch variable.
  378.     FileSize=FileSearch.Size'Determine packet file size.
  379.     Size = Size + FileSearch.Size 'Increment size of stored packets.
  380.     Print LeftPad(FileSearch.Name,12) + LeftPad(Str(Int(FileSearch.Size/100)),14)
  381.   End If 'WcMail packet has been moved to storage.
  382. ELSE
  383.   NumInt2 = Val(Mid(QWKFlag,9,1)) 'Which Comment(?) is in use.
  384.   If Trim(Left(User.Comment(NumInt2),8)) <> "QWK2 ON" Then Goto Finished
  385.   Print P4;"There are no QWK mail packets on hold for you at this time."
  386.   Print
  387.   Delay 3
  388.   Goto Finished
  389. End If 'Finished loading variables and displaying any existing packets.
  390. Print P1;"You have ";P2;QWKTotal;P1;" mail packet";
  391.   If QWKTotal > 1 Then Print "s";
  392.   Print " for a total of ";P3;Int(Size/100);P1;" Kbytes."
  393. If QWKTotal >= 1 Then
  394.   Print P1;"Do you want to download";
  395.     If QWKTotal > 1 Then
  396.       Print" all packets";
  397.     Else
  398.       Print" the packet";
  399.     End If 'If QWKTotal > 1
  400.   Print" now or just the first one?"
  401.   Print
  402.   Print P2;"The following choices are available for your use:"
  403.   Print P1;"[";P2;"A";P1;"]ll packets downloaded now and continue."
  404.   Print P1;"[";P2;"D";P1;"]ownload all packets now and log off of the BBS."
  405.   Print P1;"[";P2;"F";P1;"]irst, download only first packet and continue."
  406.   Print P1;"[";P2;"N";P1;"]o packets downloaded at this time, continue with BBS."
  407.   Print
  408.   ChaStr2 = InputMask(P1+"Choose ["+P2+"A"+P1+"]ll, ["+P2+"D"+P1+"]ownload & Goodbye, ["+P2+"F"+P1+"]irst, or ["+P2+"N"+P1+"]one ","X","A")
  409.   ChaStr2 = UCase(ChaStr2)
  410.   UKey = ChaStr2 'Set Ukey value from user's input.
  411.   If Chastr2 = "N" Then Print: Goto Finished'Abort out of here.
  412.   If ChaStr2 = "A" Then'Going for the whole hog.
  413.     If QWKTotal > 1 Then
  414.       Print P1;"The mail packets will be sent in sequence, one right after the other."
  415.       Print P3;"There will be a short pause between packets, please be patient."
  416.     End If 'End of If QWKTotal.
  417.   End If 'End checking for All Response.
  418. End If 'End of If QWKTotal > 1
  419.  
  420. If (Local) Then
  421.   Print
  422.   Print P1;"Enter the path where you want your mail packets to wind up."
  423.   Print P1;"Please use the following format shown in example: ";P2;"C:\QWK\";UCase(Trim(MakeWild.PacketId));P1;"."
  424.   QWKSysop = InputMask("-->","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")'Get local Sysop mail path.
  425.   If QWKSysop = "" Then
  426.     BadEnd = 21: Goto Problem 'Bad response from Sysop.
  427.   End If'If QWKSysop = ""
  428.   QWKSysop = Trim(UCase(QWKSysop)) 'Make it Uppercase & trim spaces.
  429.   IF Mid(QWKSysop,2,2) <> ":\" Then BadEnd = 21: Goto Problem
  430.   IF Right(QWKSysop,1) = "\" Then 'Verify no ending backslash.
  431.     NumInt1 = Len(QWKSysop) - 1
  432.     QWKSysop = Left(QWKSysop,NumInt1) 'Slash was removed
  433.   End If 'End of QWKSysop slash check.
  434. End If 'End of If (Local)
  435.  
  436. Print
  437. If UKey <> "A" Then
  438.   ChaStr2 = InputMask(P1+"Hit the Enter key to begin the file transfer or ["+P2+"A"+P1+"] to abort.","X")
  439.   If UCase(Left(ChaStr2,1)) = "A" then UKey = "": Goto Finished
  440. End If' If UKey <> "A"
  441. QWKLeft = QWKTotal 'Load in how many packets a user needs to download.
  442. For FindQWK = 0 to QWKTotal - 1
  443.   OldFile = QWKRoute + Str(User.UserID) + ".QW" + Chr(FindQWK + 65)
  444.   ChaStr2 = TempPath
  445.   NewFile = ChaStr2 + UCase(Trim(MakeWild.PacketID)) + ".QW" + Chr(FindQWK + 65)
  446.   If (Local) then
  447.     If Len(QWKSysop) <= 20 Then PushCommand QWKSysop 'PushCommand 20 char limit.
  448.   End If
  449.   CopyFile (OldFile,NewFile)' Move to temp. Can't use Name -> drive letter.
  450.   Del OldFile
  451.   If SendFile(NewFile) Then 'Goto else option if not a good send.
  452.     ChaStr2 = UCase(Trim(MakeWild.PacketID)) + ".QW" + Chr(FindQWK + 65)
  453.     ActivityLog "QWK2: File " + ChaStr2 + " was downloaded successfully."
  454.     Del NewFile 'Delete file that was sucessfully sent.
  455.     QWKLeft = QWKLeft - 1
  456.   Else
  457.     Print P4;" Mail transfer failed.";P1
  458.     CopyFile (NewFile,OldFile)' Rename and put file back in storage.
  459.     Del NewFile
  460.     ChaStr2 = UCase(Trim(MakeWild.PacketID)) + ".QW" + Chr(FindQWK + 65)
  461.     ActivityLog "QWK2: " + ChaStr2 + " was not downloaded successfully."
  462.     Exit For
  463.   End If
  464.   If Ukey = "F" Then
  465.     Print
  466.     ChaStr2 =InputMask(P1+"["+P2+"N"+P1+"]ext File, ["+P2+"S"+P1+"]top Downloading ","X","N")
  467.     If UCase(Left(ChaStr2,1)) = "S" Then
  468.       Exit For 'Early out of For loop.
  469.     End If 'Done looking for S.
  470.   End If 'End of If "F"
  471. Next FindQWK
  472.  
  473. 'Final Clean up
  474. If Not(QWKLeft = QWKTotal) Then 'At least one mail packet was transferred.
  475.    NumInt1 = QWKTotal - QWKLeft' Determine how many are left in storage.
  476.    QWKTotal = QWKLeft 'Correct total value now as something was downloaded.
  477.    For FindQWK = 0 to QWKLeft - 1
  478.      NewFile = Trim(QWKRoute) + Str(User.UserID) + ".QW" + Chr(FindQWK + 65)
  479.      OldFile = Trim(QWKRoute) + Str(User.UserID) + ".QW" + Chr(NumInt1 + 65)
  480.      Name OldFile As NewFile'Move names of left over packets to top.
  481.      NumInt1 = NumInt1 + 1
  482.    Next FindQWK
  483. End If
  484.  
  485. Goto Finished ' End Program.
  486.  
  487. '>>>----> Start of Problem Goto
  488. Problem: 'Come here if there is a drop dead error needing sysop attention.
  489. 'Note: (Problem:) is used as a Gosub or a Goto depending or BadEnd #.
  490. 'Reserve BadEnd 1 - 20 for .CFG file checking
  491.  
  492. If BadEnd >= 0 and BadEnd <=19 Then 'Something wrong with configuation file.
  493.   CLS
  494.   Print
  495.   If BadEnd = 0  Then
  496.     Print P4;"The QWK2HOLD.CFG file was not located." 'Where is it.
  497.   Else
  498.     Print P1;"Line [";P2;BadEnd;P1;"] of the ";P2;"QWK2HOLD.CFG";P1;" has a problem." 'What line is bad.
  499.   End If 'End If BadEnd = 0
  500.   Print
  501.   Print P1;"The current values of your ";P2;"QWK2HOLD.CFG";P1;" file are";P2;":"
  502.   Print P1;"Line  #1 = [";P2;WCMailRoute;P1;"]"
  503.   Print P1;"Line  #2 = [";P2;WCMailZip;P1;"]"
  504.   Print P1;"Line  #3 = [";P2;QWKRoute;P1;"]"
  505.   Print P1;"Line  #4 = [";P2;QWKFlag;P1;"]"
  506.   Print P1;"Line  #5 = [";P2;SecPro1;P1;"]"
  507.   Print P1;"Line  #6 = [";P2;SecPro2;P1;"]"
  508.   Print P1;"Line  #7 = [";P2;MaxPacket;P1;"]"
  509.   Print P1;"Line  #8 = [";P2;MaxAge;P1;"]"
  510.   Print P1;"Line  #9 = [";P2;MaxSize;P1;"]"
  511.   Print P1;"Line #10 = [";P2;MsgPlace;P1;"]"
  512.   Print P1;"Line #11 = [";P2;Mid(P1,2,2);P1;"]"
  513.   Print P1;"Line #12 = [";P2;Mid(P2,2,2);P1;"]"
  514.   Print P1;"Line #13 = [";P2;Mid(P3,2,2);P1;"]"
  515.   Print P1;"Line #14 = [";P2;Mid(P4,2,2);P1;"]"
  516.   Print P1;"Line #15 = [";P2;QWKInbound;P1;"]"
  517.   Print
  518.   Print P1;"Waiting for ";P2;"60";P1" seconds before ending program."
  519.   Delay 60
  520.   ChaStr2 = "QWK2: Your QWK2HOLD.CFG has a problem with line #"+Str(BadEnd)+"."
  521.   ActivityLog ChaStr2
  522.   Goto Finished
  523. End If 'End Error #1 - 19.
  524.  
  525. If BadEnd = 20 Then
  526.   Print
  527.   Print P1;"Your input did not make sense, you may not download your QWK"
  528.   Print P1;"packet at this time."
  529.   Print
  530.   ChaStr2 = "QWK2: User's input was confusing, program aborted."
  531.   ActivityLog ChaStr2
  532.   Goto Finished
  533. End If
  534.  
  535. If BadEnd = 21 Then
  536.   Print
  537.   Print P1;"The path you supplied could not be located.  Mail packet"
  538.   Print P1;"transfer did not take place at this time."
  539.   Print
  540.   ChaStr2 = "QWK2: User's supplied path was not located, program aborted"
  541.   ActivityLog ChaStr2
  542.   Goto Finished
  543. End If
  544.  
  545. If BadEnd = 22 Then
  546.   ChaStr2 = "QWK2: User does not have QWK checking turned on."
  547.   ActivityLog ChaStr2
  548.   Goto Finished
  549. End If
  550.  
  551. If BadEnd = 23 Then
  552.   ChaStr2 = "QWK2: User did not meet security requirements for QWK2."
  553.   ActivityLog ChaStr2
  554.   Goto Finished
  555. End If
  556.  
  557. '>>>----> End of Problem Goto
  558.  
  559. '>>>----> Come here when finished with the program
  560. Finished:
  561. ChaStr2 = "QWK2: Logon program has ended."
  562. ActivityLog ChaStr2
  563. If UKey = "D" Then 'Then Quit BBS
  564.   Goodbye True 'Log off user
  565. End If 'End of Ukey = "D"
  566. End